perm filename FIND.TES[S,DOC] blob
sn#368619 filedate 1978-07-26 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 STANFORD ARTIFICIAL INTELLIGENCE LABORATORY SEPTEMBER 1975
C00012 ENDMK
C⊗;
STANFORD ARTIFICIAL INTELLIGENCE LABORATORY SEPTEMBER 1975
SAILON-66
FIND
FIND is a system command which causes a search for a specified
key in a specified file. The FIND command has the following syntax:
FIND [EXACTLY] [WITHIN <delim>] [EXACTLY] <key> [[IN] <file>]
where square brackets [] indicate optional elements, <key> is
the string of characters to be found in the file <file>, and
<delim> is either a single character or one of the following
words: MSG LINE PAGE PARAGRAPH GRAF.
1)If <key> contains any spaces or tabs, it must be separated from the
filename <file> (if present) with the word "IN", or delimited by
double quotes (") or left and right single quotes (` and '). The
left and right quote characters (` and ') may appear in the key when
double quotes surround the key, and double quote and left single
quote characters (" and `) may appear in the key when left and right
single quotes surround the key. If the number of spaces and tabs in
the key is significant (in EXACTLY mode), the quoted form must be
used; note however that quotes do not imply EXACTLY.
2)The EXACTLY qualification (which, as indicated by the syxtax above,
may occur either before or after any WITHIN phrase) causes FIND to
search for an Exact Match. Otherwise FIND performs a Template Match.
A Template Match recognizes two special symbols in the key: Space
(one or more consecutive spaces or tabs in the key) and Ellipsis
(three or more consecutive dots). A Space in the key matches zero or
more spaces, tabs, and CRLFs in the unit being searched. An Ellipsis
in the key matches zero or more arbitrary characters in the unit
being searched. Furthermore, in a Template Match, upper and lower
case letters are equated. The EXACTLY search is somewhat quicker and
requires that the unit searched (see the WITHIN phrase below) contain
the key exactly as given.
3)The WITHIN <delim> phrase allows specification of the delimiter
that determines the amount of text searched as a unit and typed out
when a key is found. The default typeout is a PARAGRAPH except when
the partial-sign mail filename specifier is used, in which case MSG
is the default. To specify some other quantity, use the WITHIN
<delim> phrase in the command (see the syntax above). The text typed
out will be that delimited by <delim> at the beginning and at the
end. The delimiter <delim> can be specified as a single character or
it can be specified by one of the following exact names:
MSG LINE PAGE PARAGRAPH GRAF
where MSG means that partial sign (∂) is the delimiter (designed for
use with mail files), LINE means that the end of a line is the
delimiter (i.e., only the line on which the key is found will be
typed), PAGE means that formfeed (a pagemark) is the delimiter, and
PARAGRAPH or GRAF means that a blank line is the delimiter.
The delimiter character will be treated as a delimiter only if it
occurs as the first character on a line; a line starting with the
delimiter character is considered the first line in a new text unit,
and the previous line is the last line in the previous text unit.
Each separate text unit containing the key is a "HIT" and is typed
out, with each line of text preceded by an asterisk (*) except that
the line in which the key occurs is preceded by a greater-than sign
(>). Also, the hits are counted and the count is printed after the
whole file has been searched.
Within a single delimited text unit, up to about 25 lines can occur
both before and after the line in which the key is found. If more
than about 25 lines occur before and/or after the key but within the
delimited text area, an ellipsis (. . .) will be typed out before the
first line typed out and/or after the last line typed out.
4)The default file to be searched is the A.I. Lab phone directory.
However, if you have an OPTION.TXT file on your current disk area
with a line beginning "FIND:", then the default file searched will be
that named after the "FIND:". The default file is used unless you
specify a filename in your command, in which case the specified file
is searched. If you have a "FIND:<file>" entry in your OPTION.TXT
file, you can still have the phone directory searched without typing
its exact name by using the filename "PHONE" in your command.
The filename given can use the partial sign (∂) to specify a mail
file (.MSG[2,2]). The partial sign can optionally be followed by 1)a
programmer name to specify one other than your own, and/or 2)an
asterisk (*) to specify the system message mail file NOTICE.TXT,
and/or 3)an extension to specify one other than .MSG, and/or 4)a PPN
to specify one other than [2,2]. When a partial-sign filename
specification is used, the default amount of text to be searched and
typed out as a unit (see the WITHIN phrase above) is one message,
that is, all text between line-starting partial signs in the searched
file; this can be overridden using the WITHIN <delim> phrase.
For instance, the command
FIND garply baz in ∂
will search your own mail file for "garply baz" and type out the
entire message(s) it occurs in. The command
FIND EXACTLY " ME" in ∂*
(that's "<tab>ME") will find all system messages (in NOTICE.TXT[2,2]) from
ME. The command
FIND EXACTLY " ME" in ∂bh
(again that's "<tab>ME") will find all messages sent to BH by ME, and the
command
FIND president in ∂.nap
will search your own News Service notification file on [2,2] for all
notifications containing "president".
More example commands:
FIND EXACTLY JMC
FIND MCCARTHY
FIND TARGET IN COMLIN.FAI
FIND TARGET COMLIN.FAI
FIND "TEMPLATE ... TARGET" COMLIN.FAI
FIND TARGET BYTE IN COMLIN.FAI
FIND `LOMA VERDE'
FIND EVENT IN ∂*
FIND EXACTLY " E " IN ∂*
FIND WITHIN GRAF EXACTLY Help IN ∂
FIND WITHIN ∂ HAND-EYE IN SAVED.MSG
FIND WITHIN MSG PDP-11 IN OUTGO.MSG
FIND WITHIN PAGE UDPUFD IN MONCOM.BH[S,DOC
FIND EXACTLY WITHIN LINE Foo IN FILE1
FIND john...lathrop<cr>
Example output for the last example command:
*McCarthy, John (Prof. John) 208 74430 45 P[FR*/VB,JMC] 2 1600
> 846 Lathrop Dr., Stanford,94305, (9) 321-7580 β Sep 4
1 HIT ON KEY = john...lathrop